// 引入此文件需自建如下内容：
// footerButtons
import { CLUE_TYPE } from '@/constants/index';
import { mapGetters } from 'vuex';

export default {
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    detail: {
      type: Object,
      default: () => ({}),
    },
    planId: {
      type: [String, Number],
      default: '',
    },
    clueType: {
      type: String,
      default: 'creat',
    },
    processId: {
      type: [String, Number],
      default: '',
    },
    currentNode: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      paginationMixin: {
        pageSizeOptions: ['10', '20', '50', '100'],
        showSizeChanger: true,
        // showQuickJumper: true,
        current: 1,
        pageSize: 10,
        total: 0,
      },
      scrollMixin: { x: 1200, y: 380 },
      rowSelectionMixin: {
        selectedRowKeys: [],
        onChange(selectedRowKeys, selectedRows) {
          this.selectedRowKeys = selectedRowKeys;
          this.selectedRows = selectedRows;
        },
        getCheckboxProps(record) {
          return {
            props: {
              disabled: record.state === '0',
            },
          };
        },
      },
      loading: false,
      dataSource: [],
    };
  },
  computed: {
    ...mapGetters(['spinning']),

    titleName() {
      const type = `新增${CLUE_TYPE[this.clueType]}`;
      const node = this.currentNode.label;
      const status =
        this.hasEdit && this.currentNode.key !== 'Start' ? '待办' : undefined;
      return [type, node, status].filter(item => item).join('-');
    },
    // processId() {
    //   return this.detail?.plan?.processId;
    // },
    hasEdit() {
      return this.detail.isCurrentProcessor === false ? false : true;
    },
    filterButtons() {
      if (this.hasEdit) return this.footerButtons;
      return this.footerButtons.filter(item => !item.authKey);
    },
  },
  watch: {},
  methods: {},
};
